package com.java复习.练习一;

public class Television {
    private int channel; //成员变量---频道
    private int volume;  // 音量

    public int getChannel() {
        return channel;
    }

    public void setChannel(int channel) {
        if(channel<0 || channel>10){
            System.out.println("请重新输入0---10之间的数字");
        }else {
            this.channel = channel;
        }

    }

    public int getVolume() {
        return volume;
    }

    public void setVolume(int volume) {
        if (volume<2 || volume>100){
            System.out.println("请重新输入2---100之间的数字");
        }else {
            this.volume = volume;
        }
    }
}
